﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using quanlycd3lop.GUI;

namespace quanlycd3lop
{
    public partial class fr_main : Form
    {
        public fr_main()
        {
            InitializeComponent();
        }

        private void cậpNhậpToolStripMenuItem_Click(object sender, EventArgs e)
        {
           
        }

        private void danhMụcToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Boolean flag = true;
            foreach(Form f in this.MdiChildren)
            {
            if(f is frm_QLDM)
            {
                flag = false;
                f.Activate();
                break;
            }
            }
            if(flag)
                {
                    frm_QLDM CN= new frm_QLDM();
                    CN.MdiParent=this;
                    CN.Show();
                }
        }

        private void fr_main_Load(object sender, EventArgs e)
        {

        }

        private void đĩaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Boolean flag = true;
            foreach(Form f in this.MdiChildren)
            {

                if (f is frm_Shop)
                {
                    flag = false;
                    f.Activate();
                    break;
                }
            }
            if(flag)
                {
                    frm_Shop CN = new frm_Shop();
                    CN.MdiParent=(this);
                    CN.Show();
                }
        }

        private void thuêĐĩaToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Boolean flag = true;
            foreach(Form f in this.MdiChildren)
            {

                if (f is frm_ThueDia)
                {
                    flag = false;
                    f.Activate();
                    break;
                }
            }
            if(flag)
                {
                    frm_ThueDia CN = new frm_ThueDia();
                    CN.MdiParent=(this);
                    CN.Show();
                }
        }

        private void thoatToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void kháchHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Boolean flag = true;
            foreach (Form f in this.MdiChildren)
            {

                if (f is frm_KhachHang)
                {
                    flag = false;
                    f.Activate();
                    break;
                }
            }
            if (flag)
            {
                frm_KhachHang CN = new frm_KhachHang();
                CN.MdiParent = (this);
                CN.Show();
            }
        }
    }
}
